<%@ page contentType="text/html;charset=UTF-8" language="java" %>

<%@ taglib uri="/WEB-INF/myfaces_core.tld" prefix="f" %>
<%@ taglib uri="/WEB-INF/myfaces_html.tld" prefix="h" %>
<%@ taglib uri="/WEB-INF/tomahawk.tld" prefix="t" %>
<%@ taglib uri="/WEB-INF/htmLib.tld" prefix="htm" %>

<%@include file="/pages/pageTop.jspf" %>

<f:view>
    <htm:div styleClass="pageTitle">
        <t:outputText value="Student's Dashboard" />
    </htm:div>

    <htm:div styleClass="formBlock">
        <h:form id="userForm">
            <htm:div styleClass="standardBlock">
                <t:outputLabel 
                    styleClass="label"
                    value="Student: #{mbUserBean.user.name}" />
            </htm:div>
            
            <htm:div styleClass="standardBlock">
                <t:commandLink
                    styleClass="standardLink"
                    value="Submit Thesis Proposal"
                    action="#{mbUserBean.actionSubmitProposal}" />
            </htm:div>
                
            <htm:div styleClass="standardBlock">
                <t:dataTable 
	        		border="0"
	        		cellpadding="2" cellspacing="5"
	        		value="#{mbUserBean.notificationsModel}" var="notification"
	        		renderedIfEmpty="false">
	        		
	        		<t:column>
	        			<f:facet name="header">
	        				<t:outputText value="Thesis" />
	        			</f:facet>
	        			
	        			<t:outputText 
	        				value="#{notification.forThesis.title}"
	        				rendered="#{not mbUserBean.canUpdateThesis[notification.forThesis]}" />
	        				
	        			<t:commandLink 
	        				value="#{notification.forThesis.title}"
	        				action="#{mbUserBean.actionUpdateThesis}"
	        				rendered="#{mbUserBean.canUpdateThesis[notification.forThesis]}" />	
	        		</t:column>
	        		
	        		<t:column>
	        			<f:facet name="header">
	        				<t:outputText value="Last Comment" />
	        			</f:facet>
	        			
	        			<t:outputText value="#{mbUserBean.lastComment[notification.forThesis]}" />
	        		</t:column>
	        		
	        		<t:column>
	        			<f:facet name="header">
	        				<t:outputText value="Status" />
	        			</f:facet>
	        			
	        			<t:outputText value="#{notification.forThesis.status.label}" />
	        		</t:column>
	        		
	        		<t:column>
                        <f:facet name="header">
                            <t:outputText value="Assessment" />
                        </f:facet>
                        
                        <t:outputText value="#{notification.forThesis.assessment}" />
                    </t:column>
	        		
	       		</t:dataTable>
	        </htm:div>
        </h:form>
    </htm:div>            
</f:view>

<%@include file="/pages/pageBottom.jspf" %>